package algo_annotations.trt;

import algo_annotations.data.Data_a;
import algo_annotations.heuristique.TraitementSousGroupe;
import algo_annotations.params.Params_a;
import commons.utils.Utils;
import commons.utils.UtilsCalcul;
import java.awt.Color;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;


// En sortie de la DLG, si Ok pour continuer la 2eme passe, les paramètres correspondant du param sont modifiés et prêt pour lancer la passe 2
public class DialogConfigPasse2 extends javax.swing.JDialog implements DocumentListener {

	public boolean bLancePasse2;

	private Params_a params;
	private Data_a data;
	private double vitesse_pass1;


    public DialogConfigPasse2(Data_a data, Params_a params, double vitesse_pass1) {
        initComponents();
		// On traque les changements dans les textfield d'option
		// si changement de paramètres, il faut relancer une estimation
		tf_seuilNote.getDocument().addDocumentListener(this);
		tf_seuilInteraction.getDocument().addDocumentListener(this);
		tf_tailleVivier.getDocument().addDocumentListener(this);
		tf_nbIter.getDocument().addDocumentListener(this);

		this.data = data;
		this.params = params;
		this.vitesse_pass1 = vitesse_pass1;
		
		fillDlgWithParams();
		btn_EstimationActionPerformed(null);
    }


	private void fillDlgWithParams() {
		tf_seuilNote.setText("" + params.algo_seuilNote_pass2);
		tf_seuilInteraction.setText("" + params.algo_seuilInteraction_pass2);
		tf_tailleVivier.setText("" + params.algo_tailleVivier_pass2);
		tf_nbIter.setText("" + params.algo_nbIter_pass2);
	}

	// Renvoie true si OK, false si KO
	// + affiche un message d'erreur ou d'avertissement dans la DLG si besoin
	private boolean checkParams() {
		
		label_MsgErreur.setForeground(Color.RED);
		label_MsgErreur.setText("");
		String s;

		//********* Seuil note *************************************************
		s = tf_seuilNote.getText();
		if (s.length()==0) {
			label_MsgErreur.setText("Seuil note à renseigner");
			return false;
		}
		if (!Utils.isFloat_Pos(s)) {
			label_MsgErreur.setText("Seuil note doit être de type flottant >= 0");
			return false;
		}

		//********* Seuil interaction ******************************************
		s = tf_seuilInteraction.getText();
		if (s.length()==0) {
			label_MsgErreur.setText("Seuil interaction à renseigner");
			return false;
		}
		if (!Utils.isFloat_strictPos(s)) {
			label_MsgErreur.setText("Seuil interaction doit être de type entier > 0");
			return false;
		}
		double seuilInteraction = Double.parseDouble(tf_seuilInteraction.getText());
		if (seuilInteraction<=0 || seuilInteraction>=1) {
			label_MsgErreur.setText("Seuil interaction doit être dans ]0 ; 1[");
			return false;
		}

		//********* Taille vivier **********************************************
		s = tf_tailleVivier.getText();
		if (s.length()==0) {
			label_MsgErreur.setText("Taille vivier à renseigner");
			return false;
		}
		

		//********* Nb iter ****************************************************
		s = tf_nbIter.getText();
		if (s.length()==0) {
			label_MsgErreur.setText("Nb. d'itération à renseigner");
			return false;
		}
		if (!Utils.isInteger_strictPos(s)) {
			label_MsgErreur.setText("Nb. d'itération doit être de type entier > 0");
			return false;
		}

		// Arrivé là, il n'y a pas d'erreur bloquante (paramètre absent ou invalide)
		params.algo_seuilNote_pass2 = Double.parseDouble(tf_seuilNote.getText());
		params.algo_seuilInteraction_pass2 = Double.parseDouble(tf_seuilInteraction.getText());
		params.algo_tailleVivier_pass2 = Integer.parseInt(tf_tailleVivier.getText());
		params.algo_nbIter_pass2 = Integer.parseInt(tf_nbIter.getText());

		// Eventuellement, il pourrait y avoir un avertissement sur des paramètres suspects
		label_MsgErreur.setForeground(new java.awt.Color(255, 102, 0)); // orange
		if (params.algo_nbIter_pass2 < params.algo_nbIter_pass1 ||
				params.algo_tailleVivier_pass2 < params.algo_tailleVivier_pass1)
			label_MsgErreur.setText("Nb iter ou taille vivier plus petit que lors de la 1ère passe !");
		
		return true;
	}

	// vide les textfield de l'estimation
	private void clearEstimation() {
		tf_nbSousGroupe.setText("");
		tf_tailleBiggestSousGroupe.setText("");
		tf_couvertureAnno.setText("");
		tf_dureeEstimee.setText("");
	}

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        tf_seuilInteraction = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        tf_seuilNote = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        btn_Estimation = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        tf_nbIter = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        tf_tailleVivier = new javax.swing.JTextField();
        label_MsgErreur = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        tf_tailleBiggestSousGroupe = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        tf_nbSousGroupe = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        tf_dureeEstimee = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        tf_couvertureAnno = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        btn_lancerPasse2 = new javax.swing.JButton();
        btn_abandonnerPasse2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Configuration interactive de la 2ème passe");
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Paramètres de la 2ème passe", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 1, 11))); // NOI18N

        jLabel5.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel5.setText("seuil interact° :");

        jLabel4.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel4.setText("seuil note :");

        btn_Estimation.setFont(new java.awt.Font("Trebuchet MS", 0, 11)); // NOI18N
        btn_Estimation.setText("Estimation");
        btn_Estimation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_EstimationActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel6.setText("nb. itérations :");

        jLabel11.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel11.setText("taille vivier :");

        label_MsgErreur.setForeground(java.awt.Color.red);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(btn_Estimation)
                        .addGap(37, 37, 37)
                        .addComponent(label_MsgErreur, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(tf_seuilNote, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addGap(13, 13, 13)
                                .addComponent(tf_seuilInteraction, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(46, 46, 46)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(tf_nbIter, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addGap(18, 18, 18)
                                .addComponent(tf_tailleVivier)))))
                .addContainerGap(27, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(tf_seuilNote, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11)
                    .addComponent(tf_tailleVivier, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(tf_seuilInteraction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(tf_nbIter, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(label_MsgErreur, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_Estimation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Estimation des traitements nécessaires", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 1, 11))); // NOI18N

        tf_tailleBiggestSousGroupe.setEditable(false);

        jLabel9.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel9.setText("taille plus gd. sous-groupe :");

        tf_nbSousGroupe.setEditable(false);

        jLabel10.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel10.setText("nb. sous-groupe :");

        jLabel12.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel12.setText("=> durée approximative :");

        tf_dureeEstimee.setEditable(false);

        jLabel13.setFont(new java.awt.Font("Trebuchet MS", 2, 11));
        jLabel13.setText("mn");

        jLabel14.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel14.setText("couverture annotations :");

        tf_couvertureAnno.setEditable(false);

        jLabel15.setFont(new java.awt.Font("Trebuchet MS", 2, 11));
        jLabel15.setText("%");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                            .addComponent(jLabel9)
                            .addGap(13, 13, 13))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGap(1, 1, 1)
                            .addComponent(jLabel10)
                            .addGap(55, 55, 55)))
                    .addComponent(jLabel14)
                    .addComponent(jLabel12))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(tf_dureeEstimee)
                    .addComponent(tf_couvertureAnno)
                    .addComponent(tf_tailleBiggestSousGroupe)
                    .addComponent(tf_nbSousGroupe, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addGap(187, 187, 187))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(tf_nbSousGroupe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(tf_tailleBiggestSousGroupe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(tf_couvertureAnno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(tf_dureeEstimee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addGap(38, 38, 38))
        );

        btn_lancerPasse2.setBackground(new java.awt.Color(196, 230, 196));
        btn_lancerPasse2.setFont(new java.awt.Font("Trebuchet MS", 1, 11));
        btn_lancerPasse2.setText("Lancer 2ème passe");
        btn_lancerPasse2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_lancerPasse2ActionPerformed(evt);
            }
        });

        btn_abandonnerPasse2.setBackground(new java.awt.Color(237, 215, 215));
        btn_abandonnerPasse2.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        btn_abandonnerPasse2.setText("X - abandonner la 2ème passe");
        btn_abandonnerPasse2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_abandonnerPasse2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(btn_lancerPasse2)
                        .addGap(18, 18, 18)
                        .addComponent(btn_abandonnerPasse2))
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_lancerPasse2)
                    .addComponent(btn_abandonnerPasse2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void btn_lancerPasse2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_lancerPasse2ActionPerformed
		bLancePasse2 = true;
		setVisible(false);
	}//GEN-LAST:event_btn_lancerPasse2ActionPerformed

	private void btn_abandonnerPasse2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_abandonnerPasse2ActionPerformed
		bLancePasse2 = false;
		setVisible(false);
	}//GEN-LAST:event_btn_abandonnerPasse2ActionPerformed

	private void btn_EstimationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_EstimationActionPerformed
		if (!checkParams()) {
			// on interdit de lancer la 2ème passe
			btn_lancerPasse2.setEnabled(false);
			return;
		}

		// On autorise à lancer la 2ème passe
		btn_lancerPasse2.setEnabled(true);

		// Affichage des traitements et calculs que les paramètre utilisateur vont entrainer
		// On simule la creation des Traitements pour la passe 2 et on récupère ensuite les stats
		data.grpSite.prepareTraitement_pass2(data.algo.getBestGroupeAnno(), params.algo_seuilNote_pass2, params.algo_seuilInteraction_pass2);
		data.algo.createTraitements_pass2(params.algo_tailleVivier_pass2, params.algo_nbIter_pass2);

		tf_nbSousGroupe.setText(""+data.grpSite.getNbSSGroupe_pass2());
		tf_tailleBiggestSousGroupe.setText(""+data.grpSite.getSizeMaxSsGroupe_pass2());


		// Couverture annotation : quel % d'annotation on va retoucher
		double nbAnno_pass2 = 0;
		for (TraitementSousGroupe trt : data.algo.vAllTrt_pass2)
			nbAnno_pass2 += trt.sgs.size();
		tf_couvertureAnno.setText("" + UtilsCalcul.round(100 * nbAnno_pass2 / data.grpSite.nbSite_withLibelle(), 2));


		// Estimation de la durée de calcul, basée sur la vitesse de calcul de la passe 1, fournie en argument
		// calcul du nombre total de traitements elementaires de la 2eme passe
		double nbCalculsElementairesTotal_pondere=0;
		for (TraitementSousGroupe trt : data.algo.vAllTrt_pass2)
			nbCalculsElementairesTotal_pondere += trt.getNbCalculsElementaires_Total_pondere();

		if (vitesse_pass1 > 0) {
			double duree_sec = nbCalculsElementairesTotal_pondere / vitesse_pass1;
			tf_dureeEstimee.setText("" + ((int)(duree_sec/60) + 1));
		} else {
			tf_dureeEstimee.setText("?");
		}

	}//GEN-LAST:event_btn_EstimationActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Estimation;
    private javax.swing.JButton btn_abandonnerPasse2;
    private javax.swing.JButton btn_lancerPasse2;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JLabel label_MsgErreur;
    private javax.swing.JTextField tf_couvertureAnno;
    private javax.swing.JTextField tf_dureeEstimee;
    private javax.swing.JTextField tf_nbIter;
    private javax.swing.JTextField tf_nbSousGroupe;
    private javax.swing.JTextField tf_seuilInteraction;
    private javax.swing.JTextField tf_seuilNote;
    private javax.swing.JTextField tf_tailleBiggestSousGroupe;
    private javax.swing.JTextField tf_tailleVivier;
    // End of variables declaration//GEN-END:variables

	
	// Methode appelée en cas de changement dans les textfield d'option
	// si changement de paramètres, il faut relancer une estimation
	public void insertUpdate(DocumentEvent e) {
		clearEstimation();
		btn_lancerPasse2.setEnabled(false);
	}

	public void removeUpdate(DocumentEvent e) {
		clearEstimation();
		btn_lancerPasse2.setEnabled(false);
	}

	public void changedUpdate(DocumentEvent e) {
		clearEstimation();
		btn_lancerPasse2.setEnabled(false);
	}

}
